# This file describes a way how to install EAIIS on linux OS, distro Ubuntu.
# Can by run as a script but will require three actions
#    [1] When installing mysql server, root password will be required. Please provide password 'secret'
#        or edit following configuration file and change it according to your needs.
#
#        $ sudo vim include/_constants.php
#
#    [2] When editing apache configuration file, change 
#        AllowOverride directive from 'None' to 'All' for /var/www
#
#    [3] Provide root password when connecting to the Mysql database
#

echo Install all neccessary packages required by application
echo as a password for root specify 'secret'
sudo aptitude install apache2 php5 php5-gd php5-mysql libapache2-mod-php5 mysql-server-5.0

echo copy application files to /var/www .. assuming, cd rom is mounted to /media/cd-rom
sudo cp -r /media/disk/eaiis-linux/www/.* /var/www

echo verify that user running apache is www-data
ps aux | grep apache

echo chown all files in /var/www to be writable by user www-data
sudo chown www-data:www-data -R /var/www
echo make files accessible to all
sudo chmod 755 -R /var/www

echo edit apache configuration file where rules applied on /var/www are specified
echo enable AllowOverride All vor /var/www
sudo vi /etc/apache2/sites-enabled/000-default

echo enable mod_rewrite
sudo a2enmod rewrite

echo restart apache
sudo /etc/init.d/apache2 force-reload

echo install eaiis database to mysql server
mysql -u root -p < /var/www/install/eaiis.data.sql

